package cn.cas.mango.controller;

import cn.cas.mango.dto.Message;
import cn.cas.mango.dto.param.MaterialParam;
import cn.cas.mango.service.MaterialSearchService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import java.io.IOException;

/**
 * 关于material搜索的接口
 */
@Controller
@RequestMapping("/ReadingAssist/indexOperator/")
@ResponseBody
@CrossOrigin
public class MaterialSearch {
  @Autowired
  private MaterialSearchService materialSearchService;

  // 查询业务资料列表
  @RequestMapping(value = "getWorkMaterialList",method = {RequestMethod.GET})
  public Message getWorkMaterialList(MaterialParam materialParam) throws IOException {
    return materialSearchService.getWorkMaterialList(materialParam);
  }

  @RequestMapping(value = "getWorkMaterialList",method = {RequestMethod.POST})
  public Message getWorkMaterialListPost( MaterialParam materialParam) throws IOException {
    return materialSearchService.getWorkMaterialList(materialParam);
  }

}
